// TOWN DIALOGUE SCRIPT
//    Town 157: Calloc

begintalkscript;

variables;

short i,j,k,r1,choice;

// Rabellino

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Rabellino";
	text1 = "You meet the innkeeper of Calloc. He also happens to wear the mayor's sash. It's not surprising. Most of the mayors of these small towns have to work at a regular job.";
	text2 = "_I'm Rabellino. Welcome to the beautiful town of Calloc._";
	text5 = "_How else may I assist you, traveler?_ You notice that he absent-mindedly wipes up an ale stain on the bar with his mayor's sash.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_What can be had here?_";
	text1 = "_Well, we have fine luxury rooms for only 12 coins for the night. Delicious steaks are five coins. Or,_ he says with distaste, _are you here on mayor business?_";


begintalknode;
	state = 1;
	nextstate = 3;
	question = "_Need help with anything, Mayor?_";
	text1 = "He grumbles. _We could use more adventurers around here. The army deserters cause no end of trouble. And worse, we had the trouble with raiders._";

begintalknode;
	state = 3;
	nextstate = -1;
	question = "_Need our help in dealing with the Empire deserters?_";
	text1 = "_No, that's for the Empire to deal with. It's understandable, really, what with all the monsters everywhere, some of our so-called protectors are more than willing to turn coward and run, looting and stealing the possessions of good citizens._";
	text2 = "_Gut 'em all. That's what I say._";

begintalknode;
	state = 3;
	nextstate = 4;
	question = "_What sort of raids have there been?_";
	text1 = "_We've had lots of trouble with people coming in and stealing our food. Are you interested in helping us deal with them?_";
	text3 = "_We haven't had many looter problems lately, except for deserters, of course._";
	action = DEP_ON_SDF 228 9 2;

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_Tell me more about your situation._";
	code =
		run_hardcode(160);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(228,9) >= 1 && nephil_present() == 0;
	question = "_What's your opinion of the nephilim?_";
	text1 = "_Barbarians. The scum of the earth. The less of them there are, the better._ He looks you over suspiciously. _No offense, but you're lucky you weren't attacked the moment you entered town._";
	text3 = "_Barbarians. The scum of the earth. The less of them there are, the better._ He looks you over suspiciously. _No offense._";
	code =
		if (species_in_party(2))
			remove_string(1);
			else remove_string(3);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(228,9) >= 5;
	question = "_I killed off that nephilim tribe that was raiding you._";
	code =
		run_hardcode(160);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(228,9) == 2;
	question = "_I spoke to that nephilim tribe you claim is raiding your crops._";
	code =
		run_hardcode(160);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(228,9) == 3;
	question = "_It turned out that some ursagi were raiding you. They're dead now._";
	code =
		run_hardcode(160);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(157,4) >= 1;
	question = "_There were some deserters hiding in the corner of town. I killed them._";
	text1 = "_So they were deserters? I'm glad they're dead. Thanks for your help. That will teach cowards not to abandon us in our time of need._";
	
begintalknode;
	state = 1;
	nextstate = -1;
	condition = coins_amount() >= 12;
	question = "_I'll take a room for the night._ Pay 12 coins.";
	text1 = "He shows you to your room, which is anything but luxurious. You pass an uncomfortable night.";
	action = END_TALK;	
	code =
		sf(157,19,1);
		revive_party();
		change_coins(-12);
		relocate_char(get_pc_id(0),20,24,FALSE);
		relocate_char(get_pc_id(1),21,24,FALSE);
		relocate_char(get_pc_id(2),21,25,FALSE);
		relocate_char(get_pc_id(3),20,25,FALSE);
	break;
	
begintalknode;
	state = 1;
	nextstate = -1;
	condition = coins_amount() >= 5;
	question = "_Some steak, please._ Pay 5 coins.";
	text1 = "The steaks are stringy and tough. Still, they're far better than the rank lizard meat you get in Avernum. Rabellino even throws in some ale, gratis. You spend a peaceful time gnawing on meat and flirting with the other customers.";
	code =
		force_char_status(30000,3,20);
		change_coins(-5);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_All right. Don't cause any trouble._";
	action = END_TALK;

// Black

begintalknode;
	tag = 60;
	state = -1;
	nextstate = 29;
	question = "Black";
	text1 = "You meet a mage. She looks very ill, but she is working hard on a long, intricate scroll.";
	text2 = "She says, _I am Black. Welcome._ She coughs heavily into her hand.";
	text5 = "Black continues to write her scroll, occasionally interrupted by a harsh cough. She is constantly short of breath.";
	action = INTRO;

begintalknode;
	state = 29;
	nextstate = 34;
	question = "_What are you working on?_";
	text1 = "_Just some notes. Some thoughts I have about different ..._ She is interrupted by a harsh cough. _Excuse me. I'm not well._ She coughs again. _I teach magic._";
	
begintalknode;
	state = 34;
	nextstate = 37;
	question = "_Have any maps?_";
	text1 = "_Oh. Actually, I ... cough cough ... do! I have maps to Footracer and Monoroe Provinces. A hundred ... cough ... coins each._";

begintalknode;
	state = 37;
	nextstate = -1;
	condition = gf(309,22) == 0 && coins_amount() >= 100;
	question = "_I want a map of Monoroe Province._ Pay 100 coins.";
	text1 = "You pay Black and get a map in return. This expands your knowledge of Valorim.";
	text2 = "(Press the World Map button to see your map of Valorim.)";
	code =
		change_coins(-100);
		sf(309,22,1);
	break;

begintalknode;
	state = 37;
	nextstate = -1;
	condition = gf(309,23) == 0 && coins_amount() >= 100;
	question = "_I want a map of Footracer Province._ Pay 100 coins.";
	text1 = "You pay Black and get a map in return. This expands your knowledge of Valorim.";
	text2 = "(Press the World Map button to see your map of Valorim.)";
	code =
		change_coins(-100);
		sf(309,23,1);
	break;
	
begintalknode;
	state = 37;
	nextstate = 29;
	question = "_I don't need any maps._";
	text1 = "_Cough._";

begintalknode;
	state = 29;
	nextstate = 32;
	question = "_How did you become ill?_";
	text1 = "_I came here from the Isle of Bigail._ She says this as if it answers your question.";

begintalknode;
	state = 32;
	nextstate = 33;
	question = "_What does the Isle of Bigail have to do with it?_";
	text1 = "She looks at you skeptically, and coughs savagely. _You know? The isle with all the roaches? The disease spreading roaches? I came here get well, and I am. Slowly._";

begintalknode;
	state = 33;
	nextstate = -1;
	question = "_What's happened on Bigail recently?_";
	text1 = "_I don't know anything about what's going on there. I got away, and that's all there is to it._";
	text3 = "_I hear there are fewer problems with the roaches now. The island is still infested with Anama, though. So I stay away._";
	action = DEP_ON_SDF 307 5 0;

begintalknode;
	state = 29;
	nextstate = 31;
	question = "_If it's not too much of a drain, can you teach me some magic?_";
	text1 = "She coughs again. _Don't worry. I'm not contagious. I don't think. Anyway, you can purchase mage spells from me. If you want._";
	text3 = "She looks at the Anama ring on your finger. _Even if your kind was interested in my art, I would not share it with you._";
	code =
		if (has_spec_item(40) == 0)
			remove_string(3);
			else remove_string(1);
	break;

begintalknode;
	state = 31;
	nextstate = -1;
	condition = has_spec_item(40) <= 0;
	question = "_We'd like to purchase mage spells._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Black's Magic","Black is ill, so it takes much longer to receive your lesson than it might otherwise. Also, unfortunately, she is not up to teaching you some of the more demanding spells.",108,5,3);
	break;

begintalknode;
	state = 31;
	nextstate = -1;
	condition = has_spec_item(40) <= 0;
	question = "_I don't need any training._";
	text1 = "She tries to respond, but a fit of coughing doubles her over.";
	action = END_TALK;

// Miranda

begintalknode;
	tag = 80;
	state = -1;
	nextstate = 60;
	question = "Miranda";
	text1 = "This woman sits quietly in the corner of the inn. You normally wouldn't give her a second glance, except that you think you can see the outlines of multiple weapons under her dress.";
	text2 = "She looks up at you when you approach. _Greetings. I am Miranda. Don't see many new faces in these wild lands, traveler._";
	text5 = "Miranda watches you silently. Though her dress covers her well, the way she moves makes you think she has a lot of muscle under there.";
	action = INTRO;

begintalknode;
	state = 60;
	nextstate = 61;
	question = "_This is a dangerous area to live in._";
	text1 = "_Agreed. But Footracer Province was worse._";

begintalknode;
	state = 61;
	nextstate = -1;
	question = "_Was it?_";
	text1 = "_Yes. It is a ruin now. To the north, walled in, abandoned by the Empire. It was my home. My family lived there. All gone, lost to the monsters._";

begintalknode;
	state = 60;
	nextstate = 62;
	question = "_What do you do here in Calloc?_";
	text1 = "_I wait. I plan. I seek a purpose._";

begintalknode;
	state = 62;
	nextstate = 63;
	question = "_Why do you need a purpose?_";
	text1 = "_Because my old life is gone. I was a hunter in Footracer Province. I hunted dangerous monsters. But then more monsters came than we could ever handle, and we had to flee. Those of us who weren't killed, that is._";
	text2 = "_And now I wait._";

begintalknode;
	state = 63;
	nextstate = 64;
	question = "_What do you wait for?_";
	text1 = "_I wait for a way to get back into Footracer Province, to break through the walls and fight the alien beasts again. To reclaim my home._";

begintalknode;
	state = 64;
	nextstate = -1;
	question = "_I will see if I can help._";
	text1 = "_Will you? Perhaps you might. The Empire abandoned us. That means we have to rely on strangers._";
	action = END_TALK;

begintalknode;
	state = 64;
	nextstate = -1;
	question = "_I see. That is a sad tale. I wish you the best of luck._";
	text1 = "_I need luck. All fortune has abandoned me, abandoned all of us. I wish you safe travels._";
	action = END_TALK;

